import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

const userRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		meta: {
			title: "用户管理"
		},
		children: [
			{
				path: "/user/index",
				element: lazyLoad(React.lazy(() => import("@/views/user/UserList/index"))),
				meta: {
					requiresAuth: true,
					title: "用户列表",
					key: "userList"
				}
			},
			{
				path: "/user/role",
				element: lazyLoad(React.lazy(() => import("@/views/user/RoleList/index"))),
				meta: {
					requiresAuth: true,
					title: "我的角色",
					key: "role"
				}
			},
			{
				path: "/user/permission",
				element: lazyLoad(React.lazy(() => import("@/views/user/PermissionList/index"))),
				meta: {
					requiresAuth: true,
					title: "我的权限",
					key: "permission"
				}
			},
			{
				path: "/user/rolepermission",
				element: lazyLoad(React.lazy(() => import("@/views/user/RolePermission/index"))),
				meta: {
					requiresAuth: true,
					title: "角色权限",
					key: "rolepermission"
				}
			},
			{
				path: "/user/userrole",
				element: lazyLoad(React.lazy(() => import("@/views/user/UserRole/index"))),
				meta: {
					requiresAuth: true,
					title: "用户角色",
					key: "userrole"
				}
			}
		]
	}
];

export default userRouter;
